Definitions of Terminology |
Song Within this system, this indicates background music or sound effects. |
Song Data MIDI data created in a standard MIDI format. (See: Song ). Or, data that has been converted by an mks4agb system so that MIDI data can be used on a sound driver. |
Waveform Data Waveform data in AIFF (Audio Interchange File Format). Or, data that has been converted by an mks4agb system so that AIFF data can be used on a sound driver. |
Priority When a song is about to be played in excess of the maximum number of simultaneously-produced sounds, these values are used to determine which sounds to prioritize and produce. These can be set for each song and track and those totals become the priorities for the tracks themselves. |
agb_c2s.bat This is a sample program batch file supplied with the Game Boy Advance Developers Kit 2.0. |
Clock This is the pulse unit used in the timing control of the sequencer. In this sound driver, a quarter note is composed of 24 clocks. |
System Configuration Files |
mks4agb.exe Sound Object Automatic Creation Program |
mks4agb.ini Sound Object Creation Set Up File |
aif2agb.exe Converter that changes {wavename}.aif files to {wavename}.s files |
mid2agb.exe Converter that changes {songname}.mid files to {songname}.s files |
MusicPlayDef.s Source file included in each set of song data. It is automatically included. |
mks4agbLib.h Source include file for incorporation into games. |
mks4agbLib.o Source library code for incorporation into games. |
m4aLibOD1.o Source library code when ONLY DMA1 selected. |
m4aLibUSC.o Source library code when SYS_ROM selected. |
SoundMon.o Simple Monitor Object File (Main Module) |
crt0.o Simple Monitor Object File (Parts Module) |
Simple Monitor Displays |
VGR (Cannot be
changed.) The figures in this column are the numbers of the tone color group which the song selected in the SONG column uses. It is only a display, and you cannot change it. |
VOL (Cannot be
changed.) The figures in this column are the master volume values of the song selected in the SONG column. It is only a display, and you cannot change it. |
PRI (Cannot be
changed.) The figures in this column are the values for priority of the song selected in the SONG column. It is only a display, and you cannot change it. |
D/A BIT(Control Pad: Select
with Up or Down and change the Value with Left or Right.) This is the final output DA conversion bit number. It can be changed using Right/Left on the Control Pad. |
SIZE (Cannot
Change ) The total size of all sound objects incorporated into the game. |
MIDI:VGR (Control
Pad : Select with Up or Down and change the Value with Left
or Right.) This is the tone color group number used with MIDI input performance. It can be changed using Left/Right on the Control Pad, but this change only takes effect once a MIDI program change ($Cx) is done. |
:VOL (Control
Pad : Select with Up or Down and change the Value with Left
or Right.) This is the value for the MIDI input performance master volume. It can be changed using Left/Right on the Control Pad. |
:PRI (Control
Pad : Select with Up or Down and change the Value with Left
or Right.) This is the value for the MIDI input performance priority. It can be changed using Left/Right on the Control Pad. |
System Configuration Directories |
Work Directory This is a newly allotted directory which serves as a reference position when developing sound object groups. A separate directory must be allotted for each game. In the example used in the tutorial in this manual, it is C:\Mks4agb. |
Waveform Data Input
Directory This is the directory where waveform data files created by the user are placed. This refers to the settings (aif_dir) made in mks4agb.ini. |
Song Data Input Directory This is the directory where song data files created by the user are placed. This refers to the settings (mid_dir) made in mks4agb.ini. |
Source File Directory This is the directory where .s file groups are output after running mks4agb.exe. This refers to the settings (src_dir) made in mks4agb.ini. |
Output Directory This is the directory where sound object groups are output after running mks4agb.exe. This refers to the settings (out_dir) made in mks4agb.ini. All files output to this directory will be passed to the main program side. |
mks4agb.ini Parameters |
Rebuild Switch (mks4agb.ini :
rebuild) This is a parameter for building (Make function) sound objects when running mks4agb.exe. Normally it is "0," but when rebuilding (Make all), it is set to "1." |
AGB System Library File Directory
(mks4agb.ini : agb_lib) This is the directory for the library file group provided with the Game Boy Advance Developer ToolKit 2.4. When set up according to the toolsSetup.txt file included with this kit, the location will be {Drive Name}:\agb\lib. |
GCC Execution Path (mks4agb.ini :
cmd_path) This is the execution path for GCC and other compilers. When set up according to the toolSetup.txt file in the Game Boy Advance Developer ToolKit 2.4, the directory will be in the path specified in agb_c2s.bat provided with that kit. (thumbelf is specified.) |
Initial Set Up Values for
Sound Modes (mks4agb.ini : mode_i) The sound modes are specified when the sound functions start. The sound modes are: the number of simultaneously produced direct sounds, the master volume of direct sounds, the playback frequency of direct sounds and the number of final output DA conversion bits. The initialization values of each of these can be specified. |
Starting Tone Color Group
Setup (mks4agb.ini : vgroup) The tone colors set up are gathered into groups and the tone color group to be used for each song is specified. Dividing them into groups makes it possible to have more tone color settings. (This is because the tone color numbers from 0 ~ 127 can be used for each group.) |
Tone Color Setup (mks4agb.ini :
p???) Tone Color settings may be specified from 0 ~ 127 for each of the tone color groups. It is possible to specify a different tone color by changing a single parameter of a unit of sampled waveform data. Since compatible sounds and direct sounds are set up in different ways, it is important to take precautions. |
Key Split Table Setup (mks4agb.ini :
t???) When "Key Split Tone Color" of the tone color settings is selected, the table set up here will be referenced. |
Sound 3 Waveform Setup(mks4agb.ini
: w???) With AGB, you can choose between 32 and 64 steps using the "Specify Sound 3 Waveform RAM Data Combination Settings". But this sound driver can only handle 32 steps. This means that waveforms will be written with 32-character hexadecimals. |
Music Player Setup (mks4agb.ini
: mp??) This is where the number of Music Players used during a game and the number of tracks for those music players are declared. |
Song Setup (mks4agb.ini : s???) This is where the song number, tone color group, and priority are set for each song. When a song begins during a game, the identified song numbers will be specified here. |
MIDI Input Performance Setup (mks4agb.ini :
pbymidi) Turning this switch on sends MIDI data from a keyboard or another device directly into a MIDI input-compatible cartridge. This makes it possible to output sound while having the characteristics specified in the .ini file from an AGB device. In other words, turning on this switch makes it possible to compose music while playing it with the desired tone color. Song data cannot be created in real-time while performing. |
Memory Access Area Size
(mks4agb.ini : memacc_s) In this system, you can write data to a special RAM area by placing a MEMACC instruction in the song data. Designate the size of this RAM area to be between 0~255. (Default Value: 16) |
Maximum Lines for Processing Time
of m4aSoundMain( ) (mks4agb.ini : max_line) The processing time for m4aSoundMain( ) for each 1/60 second frame is limited by the approximate number of scan lines. This setting value is the processing time - not the location of the scan lines to stop processing. It is impossible to accurately limit time so in actuality, the setting value is exceeded by a certain number of lines. If a "0" is set, this function has no effect. |
DMA Limit Switch (mks4agb.ini :
only_dma1) This system normally uses 2 channels for the AGB DMA function. When a value other than 0 is set, only one channel is used. Then the output of the direct sound becomes monaural and the processing time becomes faster. Enable this switch when requested by a programmer. |
System ROM Use Switch
(mks4agb.ini : sys_rom) By setting this to a value other than 0, the sound code in the system ROM is used, and the code in Game Pak ROM and internal RAM can be minimized. However, be aware that with versions that do not use System ROM, there are limitations and differences in functionality. |
Input Data Files (Created by User) |
{wavename}.aif Waveform Data File (AIFF Format) |
{songname}.mid Song Data File (Standard MIDI Format) (See: Song Data) |
Output Files (After running mks4agb.exe.) |
Source File The input data is converted into .s files(*.s). |
{wavename}.s (Source File) {wavename}.aif files converted using aif2agb.exe |
{songname}.s (Source File) {songname}.midfiles converted using mid2agb.exe |
SoundDat.s (Source File) Other automatically generated data(tone color, song tables, etc.) |
MPlayDef.s (Source File) Song Data Include Files |
SndMonDat.s (Source File) Data used with Simple Monitor |
Sound Objects Files passed over to the main programmer(s) |
{wavename}.o (Sound Objects) Waveform data object files |
{songname}.o (Sound Objects) Song data object files |
SoundDat.o (Sound Objects) Other data object files |
m4aLib.o (Sound Objects) Library code used when incorporating to games |
m4aLib.h (Sound Objects) Include files used when incorporating to games |
SoundFiles (Sound Objects) List of all sound object files. This is included and used with Makefile of the main program. |
Items Created in Working Directory |
SoundMon.map Simple Monitor .map file |
SoundMon.elf Simple Monitor .elf file (Executable file) |
SndMonDat.o Object File for Simple Monitor Data |
.s File Contents |
Wxx Wait xx clocks before executing the next command. This can be thought of as a "rest." xx is a two-digit, single-byte number from 00-96, but the numbers do not always have to be in sequence. (Values not defined in MusicPlayDef.s cannot be used.) Note: The length of a quarter rest is 24 clocks; that of a whole rest is 96 clocks. |
FINE Pronounced "feeneh". This ends the track. |
GOTO, label Unconditional jump to the label position. (Labels are 4 bytes.) |
PATT, label Calls a label pattern. Can be nested up to three times. |
PEND Ends the pattern, calls and restores to original state. If there is no call from anywhere, it will be ignored. |
TEMPO, xx/2 This sets the tempo for the entire song. (xx is from 2 to 510). |
KEYSH, xx This shifts the key of the track in question. (xx is from -128 to +127). (Note: This command cannot be specified on a MIDI sequencer.) |
MEMACC, mem_set, adr, dat 1 byte of data is written to the Memory Access Area. |
VOICE, xx Selects the tone color. (xx is from 0 to 127). The tone color specified in mks4agb.ini will be selected. |
VOL, xx Track Volume (xx is 0 to 127) Note: In order to make the master volume song setup valid, xx has to be specified using the formula [Value * {songname}_mvl/mxv]. |
PAN, c_v+xx Panpot of a track (xx is from -64 to +63) Note: Due to hardware limitations with CGB compatible sound, there are just three stages: right, middle and left. |
BEND, c_v+xx The bending of a pitch on a track (xx is from -64 to +63). |
LFOS, xx Low Frequency Oscillator Speed (xx is from 0 to 127). This is the modulation speed. The higher the value, the higher the speed. |
LFODL, xx The time from "key on" until the LFO takes effect (xx is from 0 to 127). When this value is something other than "0", modulation and other effects will not work immediately following "key on." It takes effect after xxclocks have passed. |
MOD, xx Modulation Depth (xx is from 0 to 127) |
TUNE, c_v+xx Tuning (xx is from -64 to +63) The pitch of a track may be fine-tuned in }(half tone) increments. |
Nxx [ ,key [ ,velo [ ,gtp? ] ] ] A "note" specifying a gate time of xx clocks. xx is a two-digit, single-byte number from 00 to 96, but it does not necessarily have to be in sequence. (Values not defined in MusicPlayDef.s cannot be used.) The length of a quarter note is 24 clocks; that of a whole note is 96 clocks. |
TIE [ ,key [ ,velo] ] This is a tied note. The note will continue until there is an "EOT". "key" refers to the scale, from CnM2 to Gn8, and "velo" is the velocity from v000 to v127. |
EOT [ ,key ] This command ends a tied note. "key" is the scale of the note to be stopped from CnM2 to Gn8. |
XCMD, xIECL, xx Pseudo-Echo Length (xx is from 0 to 127). The pseudo-echo will remain for a period of xx/60 seconds. |